using System;
using System.Collections.Generic;
using System.Text;
using System.ComponentModel;
using Microsoft.Practices.RepositoryFactory.CodeGeneration.ObjectModel.Mappings;
using Microsoft.Practices.RepositoryFactory.Converters; 

namespace Microsoft.Practices.RepositoryFactory.CodeGeneration.ObjectModel
{
    /// <summary/>
    public class Entity
    {
        #region Entity Properties

        private string _name;
        private string _namespace;
        private List<Property> _properties;
        private List<EntityStoredProcedureMapping> _storedProcedureMappings;
        private string _tableName;

        /// <summary>
        /// Gets or sets the name.
        /// </summary>
        /// <value>The name.</value>
        [TypeConverter(typeof(CSharpIdentifierConverter))]
        public string Name
        {
            get { return _name; }
            set { _name = value; }
        }

       
        /// <summary>
        /// Gets or sets the properties.
        /// </summary>
        /// <value>The properties.</value>
        [Browsable(false)]
        public List<Property> Properties
        {
            get { return _properties; }
            set { _properties = value; }
        }
        #endregion

        [Browsable(false)]
        public string Namespace
        {
            get
            {
                return _namespace;
            }
            set
            {
                _namespace = value;
            }
        }
         

        #region Table Mappings

        /// <summary>
        /// Gets or sets the name of the table.
        /// </summary>
        /// <value>The name of the table.</value>
        [Browsable(false)]
        public string TableName
        {
            get { return _tableName; }
            set { _tableName = value; }
        }



        /// <summary>
        /// Gets or sets the stored procedure mappings.
        /// </summary>
        /// <value>The stored procedure mappings.</value>
        [Browsable(false)]
        public List<EntityStoredProcedureMapping> StoredProcedureMappings
        {
            get { return _storedProcedureMappings; }
            set { _storedProcedureMappings = value; }
        }
        #endregion

        #region Constructors
        /// <summary>
        /// Initializes a new instance of the <see cref="T:SqlServerTable"/> class.
        /// </summary>
        public Entity()
        {
            _properties = new List<Property>();
            _storedProcedureMappings = new List<EntityStoredProcedureMapping>();
            _namespace = string.Empty;
        } 
        #endregion
    }
}
